package cn.edu.nwafu.nic.nucleic_acid_test.controller;

import cn.edu.nwafu.nic.nucleic_acid_test.common.Result;
import cn.edu.nwafu.nic.nucleic_acid_test.entities.Dept;
import cn.edu.nwafu.nic.nucleic_acid_test.services.DeptService;
import cn.edu.nwafu.nic.nucleic_acid_test.services.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: SungLee
 * @date: 2022-02-19 19:21
 * @description: User相关的Controller
 */
@RestController
@RequestMapping("/api/dept")
@Api(tags = "部门相关操作接口")
public class DeptController {
    private static final Logger logger = LoggerFactory.getLogger(DeptController.class);
    @Autowired
    private DeptService deptService;
    @ApiOperation(value = "部门列表",notes="查询所有部门")
    @RequestMapping(path = "/list", method = RequestMethod.GET)
    public Result list() {
        List<Dept> deptList = deptService.list();
        return Result.success(deptList);
    }

}
